﻿using UnityEngine;
using System.Collections;

public class GfxWireLine : MonoBehaviour {

	public Wire inputWire;
	public LineRenderer outputLine;
	public Vector3 offset;

	public Vector3 start;
	public Vector3 end;

	// Use this for initialization
	void Start () {

	
	}
	
	// Update is called once per frame
	void Update () {
	
		Neuron input = inputWire.neuronInput;
		Neuron output = inputWire.neuronOutput;
		
		start = input.gameObject.transform.position;
		end = output.gameObject.transform.position;

		float cs, ce;
		cs = inputWire.probeInputFloat;
		ce = inputWire.probeOutputFloat;
		outputLine.SetColors (new Color(cs, cs, cs, 1), new Color(ce, ce, ce, 1));
		
		outputLine.SetPosition (0, start + offset);
		outputLine.SetPosition (1, end + offset);

	}
}
